package com.adopapa.nezhacloud.authc.service;

import java.util.concurrent.TimeUnit;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import com.adopapa.nezhacloud.redis.RedisService;

import jakarta.annotation.PostConstruct;

@Service
public class TestService {
	
	
	@Autowired
	private RedisService redisService;
	
	
	@PostConstruct
	public void test() {
		
		RedisTemplate<String, Object> redisTemplate = redisService.getRedisTemplate(0);
		redisTemplate.opsForValue().set("happy", "hello12344556789", 100L, TimeUnit.SECONDS);
		System.out.println(redisTemplate.opsForValue().get("happy"));
		
	}

}
